<?php 
use App\Middleware\Auth;

$router->get('/', function() {
    return 'HelloVod！';
});

//访问控制器
$router->get('hello','App\Controllers\IndexController@index')->middleware(Auth::class);
// 动态路由
$router->get('hello/{id}','App\Controllers\IndexController@hello');
$router->post('hello','App\Controllers\IndexController@index')->middleware(Auth::class);

// 当上面的都匹配不到时
$router->fallback(function() {
    return require __DIR__.'./../error/404.html';
});